let str = `张浩亮,邓敏,陈城,戚志东,林鹏,杨素,乔千禧,何俊宇,莫虎,李成科,郑辉,孙奥,张书宁,赵施敏,杨占力,李雷,李嵩涛,徐梓潇,周翔宇,杨雷,涂域琴,雷景翔,邵云川,陈阳,董贝乐,李雪颖`;
// string -> array
let nameList = str.split(',');

function fn(count) {
    let arr = [];
    for (let i = 0; i < count; i++) {
        let i = random(nameList.length - 1); // 随机下标
        arr.push(nameList[i]);
        nameList.splice(i, 1);
    }
    console.log(arr);
}
fn(3);
fn(2);
fn(1);

function random(min, max) {
    if (!max) {
        [max, min] = [min, 0];
    }
    if (min > max) {
        [max, min] = [min, max];
    }
    return parseInt(Math.random() * (max + 1 - min) + min);
}